/ Assembly List / LJCNetCommon / HTMLBuilder / GetBegin

Namespace - LJCNetCommon


Parameters
name - The element name.
textState - The current text state values.
htmlAttribs - The element attributes.
addIndent - Indicates if the element can be indented.
childIndent - Indicates if the child indent should be applied.

Returns

The HTML element begin tag.

Syntax

C#
public String GetBegin(String name, TextState textState, Attributes htmlAttribs = null, Boolean addIndent = True, Boolean childIndent = True)

Gets the element begin tag.

Remarks

GetBegin() is an "GetText" method which creates the element opening tag with GetCreate() and returns the text value.
Note: One should set the "addIndent" parameter to false when adding text to the builder after getting the text with a "GetText" method. This is because the the indent has already been added with the "GetText" method.

Example

C#
// Root Method Begin
var textState = new TextState();

// Defaults: IndentCharCount = 2, LineLimit = 80, WrapEnabled = false.
var hb = new HTMLBuilder();

// Example Method:
// Starts the text with a newline if the builder already has text
// and param allowNewLine = true and builder text does not end with
// a newline.
// The text begins with the current indent string if param
// addIndent = true.
// Defaults: addIndent = true, allowNewLine = true.
var result = hb.GetBegin("body", textState);

// result:
// <body>

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.